﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="util.aspx.vb" Inherits="admin_util" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:SqlDataSource ID="dsProperties" runat="server" 
            ConnectionString="<%$ ConnectionStrings:Henson Family %>" 
            SelectCommand="SELECT [Property], [DataType] FROM [Properties] ORDER BY [Id]"></asp:SqlDataSource>
    
    
        <asp:Repeater ID="repPrivate" runat="server" DataSourceID="dsProperties">
            <HeaderTemplate>
                <h3>Privates</h3>
            </HeaderTemplate>
            <ItemTemplate>
                Private _<%#Eval("Property")%> As <%#Eval("DataType")%> <br />
            </ItemTemplate>
        </asp:Repeater>
        
        <asp:Repeater ID="repPublic" runat="server" DataSourceID="dsProperties">
            <HeaderTemplate>
                <h3>Public Properties</h3>
            </HeaderTemplate>
            <ItemTemplate>
<pre>
Public Property <%#Eval("Property")%>() As <%#Eval("DataType")%>
    Get
        Return _<%#Eval("Property")%>
    End Get
    Set(ByVal value As <%#Eval("DataType")%>)
        _<%#Eval("Property")%> = value
    End Set
End Property
</pre>
            </ItemTemplate>
        </asp:Repeater>
        
        <asp:Repeater ID="repNew" runat="server" DataSourceID="dsProperties">
            <HeaderTemplate>
                <h3>Public Properties</h3>
            </HeaderTemplate>
            <ItemTemplate>

_<%#Eval("Property")%> = value<br />
            </ItemTemplate>
        </asp:Repeater>
        
        <asp:Repeater ID="Repeater1" runat="server" DataSourceID="dsProperties">
            <HeaderTemplate>
                <h3>DataTable</h3>
        Public Function dtFamilies() As DataTable<br />
            Dim dt As New DataTable("Families")<br />
            </HeaderTemplate>
            <ItemTemplate>
<pre>Dim dc<%#Eval("Property")%> As New DataColumn("<%#Eval("Property")%>", GetType(<%#Eval("DataType")%>))</pre>
            </ItemTemplate>
        </asp:Repeater>
        
        <asp:Repeater ID="Repeater2" runat="server" DataSourceID="dsProperties">
            <ItemTemplate>
<pre>
            dt.Columns.Add(dc<%#Eval("Property")%>)
</pre>

            </ItemTemplate>
            <FooterTemplate>
                Return dt<br />
            End Function
            </FooterTemplate>
        </asp:Repeater>        
        
 <div>
         <asp:Repeater ID="repFormView" runat="server" DataSourceID="dsProperties">
            <ItemTemplate>

&lt;div class="formRow"&gt;<br />
    &lt;span class="formField"&gt;<%#Eval("Property")%>:&lt;/span&gt;<br />
    &lt;asp:Label ID="lbl<%#Eval("Property")%>" runat="server" Text='&lt;%#Eval("<%#Eval("Property")%>")%&gt;' /&gt;<br />
&lt;/div&gt;<br />


            </ItemTemplate>
        </asp:Repeater>        
       </div>
        
 <div>
         <asp:Repeater ID="repFormViewEdit" runat="server" DataSourceID="dsProperties">
            <ItemTemplate>

&lt;div class="formRow"&gt;<br />
    &lt;span class="formField"&gt;<%#Eval("Property")%>:&lt;/span&gt;<br />
    &lt;asp:TextBox ID="lbl<%#Eval("Property")%>" runat="server" Text='&lt;%#Bind("<%#Eval("Property")%>")%&gt;' /&gt;<br />
&lt;/div&gt;<br />


            </ItemTemplate>
        </asp:Repeater>  
        
        <asp:Repeater ID="Repeater5" runat="server" DataSourceID="dsProperties">
            <HeaderTemplate>
                <h3>SQL Paramaters</h3>
            </HeaderTemplate>
            <ItemTemplate>
                    Dim txt<%#Eval("Property")%> As TextBox = CType(row.FindControl("txt<%#Eval("Property")%>"), TextBox)  <br />          
            </ItemTemplate>
        </asp:Repeater>         
        
        <asp:Repeater ID="Repeater6" runat="server" DataSourceID="dsProperties">
            <HeaderTemplate>
                <h3>SQL Paramaters</h3>
            </HeaderTemplate>
            <ItemTemplate>
                @<%#Eval("Property")%> <%#Eval("DataType")%>,<br />
            </ItemTemplate>
        </asp:Repeater> 
        
        <asp:Repeater ID="Repeater22" runat="server" DataSourceID="dsProperties">
            <HeaderTemplate>
                <h3>Set Privates</h3>
            </HeaderTemplate>
            <ItemTemplate>
<pre>
e.Values.Add("<%#Eval("Property")%>", txt<%#Eval("Property")%>.Text)
</pre>
            </ItemTemplate>
            <FooterTemplate>
                Return dt<br />
            End Function
            </FooterTemplate>
        </asp:Repeater>    
                

        <asp:Repeater ID="Repeater3" runat="server" DataSourceID="dsProperties">
            <HeaderTemplate>
                <h3>SQL Paramaters</h3>
            </HeaderTemplate>
            <ItemTemplate>
comm.Parameters.AddWithValue("@<%#Eval("Property")%>", _<%#Eval("Property")%>)<br />
            </ItemTemplate>
        </asp:Repeater>         
        
        <asp:Repeater ID="Repeater4" runat="server" DataSourceID="dsProperties">
            <HeaderTemplate>
                <h3>SQL Paramaters</h3>
            </HeaderTemplate>
            <ItemTemplate>
                @<%#Eval("Property")%> <%#Eval("DataType")%>,<br />
            </ItemTemplate>
        </asp:Repeater> 
       </div>
    </div>
    </form>
</body>
</html>
